# FROM m.daocloud.io/docker.io/library/node:20.5.0
# # FROM node:16.11.1
# MAINTAINER fx 2388908676@qq.com
# WORKDIR /usr/src/app

# COPY . .
# RUN npm config set registry https://registry.npmmirror.com
# RUN npm install -g npm@10.8.1
# RUN npm install --legacy-peer-deps

# CMD ["node", "main.js"]

FROM m.daocloud.io/docker.io/node:16.11.1 as builder
MAINTAINER fx 2388908676@qq.com
ADD . .
RUN npm config set registry https://registry.npmmirror.com
RUN npm install && npm run build

FROM m.daocloud.io/docker.io/node:16.11.1 as builder2
WORKDIR /usr/src/app
COPY --from=builder dist ./
COPY --from=builder node_modules ./node_modules/
COPY --from=builder package.json ./
COPY --from=builder ormconfig.js ./
CMD ["node", "main.js"]
